package zb;

import java.io.*;

/**
 * @author wzby
 * @Date: 2022/7/29 20:59
 */
public class File4 {
    public static void main(String[] args) {
        //读取文本文件1字节流
        //统计行数
       String f = "E:\\idea\\java\\ch09\\src\\zb\\File1.java";
       try(var fis = new FileInputStream(f)){
            System.out.println(new String(fis.readAllBytes()).lines().count());
            System.out.println(new String(fis.readAllBytes()));
        }catch (IOException e){

        }
       System.out.println("==".repeat(20));
        try (var reader = new BufferedReader(new FileReader("ch09/src/f/a.txt"))){
            while (reader.ready()){
                System.out.println(reader.readLine());
            }
        }catch(IOException e){
            throw new RuntimeException(e);
        }
    }
}
